package com.dd.cloud.user.service.chknowl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dd.cloud.user.entity.chknowl.ChknowlBooksCtlg;
import com.dd.cloud.user.entity.chknowl.ChknowlBooksPresent;
import com.dd.cloud.user.entity.file.FileInfo;
import com.dd.cloud.user.req.chknowl.ChBooksPageReq;
import com.dd.cloud.user.req.chknowl.ChknowlBooksCreateReq;
import com.dd.cloud.user.req.chknowl.ChknowlBooksUpdateReq;
import com.dd.cloud.user.res.chknowl.ChBooksCategoryRes;
import com.dd.cloud.user.res.chknowl.ChknowlBooksDetailRes;
import com.dd.cloud.user.res.chknowl.ChknowlBooksPresentPageRes;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 * 古典书籍内容表 服务类
 * </p>
 *
 * @author czg
 * @since 2022-07-04
 */
public interface IChknowlBooksPresentService extends IService<ChknowlBooksPresent> {

    /**
     * 获取书籍大类
     *
     * @return
     */
    List<ChBooksCategoryRes> getCategory();

    /**
     * 获取大类中所有的书籍
     *
     * @param req
     * @return
     */
    IPage<ChknowlBooksPresentPageRes> getCategoryBookList(ChBooksPageReq req);

    /**
     * 查询书籍首页内容
     * @param bookId
     * @return
     */
    ChknowlBooksPresentPageRes getCategoryBook(Integer bookId);

    /**
     * 通过id和目录层级获取书籍内容
     *
     * @param id
     * @param rankId
     * @return
     */
    ChknowlBooksCtlg getContent(Integer id, Integer rankId);

    /**
     * 禁用或删除书籍
     *
     * @param bookId
     * @param status
     */
    void updateBookContentStatus(Integer bookId, Integer status);

    /**
     * 添加书籍
     *
     * @param req
     */
    void addBook(ChknowlBooksCreateReq req);

    /**
     * 添加书籍
     *
     * @param req
     */
    void updateBook(ChknowlBooksUpdateReq req);


    /**
     * 查询书籍详细内容
     * @param bookId
     * @return
     */
    ChknowlBooksDetailRes getBookDetail(Integer bookId);

    /**
     * 手动上传书籍
     * @param files
     * @return
     */
    List<FileInfo> uploadMultipleFile(MultipartFile[] files);

    /**
     * 上传数据
     * @param files
     */
    void addBookBatch(MultipartFile[] files);

    /**
     * 获取书籍目录
     * @param bookId
     */
    void getBookTransition(Integer bookId);

    /**
     * 导入书籍
     */
    void importBookBatch(MultipartFile file);

    /**
     * 导入书籍图片
     * @param files
     */
    void importBookImgBatch();

    /**
     * 导入数据two
     * @param file
     */
    void importBookBatchTwo(MultipartFile file);
}
